package Application.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import Application.entity.Result;
import Application.entity.Teacher;
import Application.service.TeacherService;

@CrossOrigin	
@RestController
@RequestMapping("/Teacher")
public class TeacherControl {
	
	@Resource
	private TeacherService service;
	
	@PostMapping("/insertTeacher")
	public Result insertTeacher(Teacher teacher) {
		return service.insertTeacher(teacher);
	}
	
	@PostMapping("/checklog")
	public Result checlog(Teacher teacher) {
		return service.checklog(teacher);
	}
	
	@PostMapping("/findTeacherById")
	public Teacher findTeacherById(int id) {
		return service.findTeacherById(id);
	}
}
